home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / SHELLS / SZ2 / ALTF1.PAT < prev    next >
Text File  |  1992-08-31  |  3KB  |  78 lines

  1.  UNIT:  HELPFILE.PAS
  2. PATCH:  Add "Alt-F1" for previous help screen.
  3. NOTES:  This patch, along with SHAZAM II, allows Turbo Vision programs
  4.         to recall the last 20 help screens.
  5.  
  6.  
  7.  
  8. Add the lines marked with {!!}, plus "Push" and "Pop" procedures.
  9. -----------------------------------------------------------------------
  10.    {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  11.    Global - add after "CHelpWindow" palette
  12.    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
  13. CONST
  14.    MaxHelp                   = 20 ;    {!!}             { max screens }
  15. VAR
  16.    StackHelp                 : array [ 1..MaxHelp ] of
  17.                                integer ;          {!!} { screen stack }
  18.    {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  19.    Add BEFORE "THelpViewer.HandleEvent ( ) ;"
  20.    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
  21. procedure PushRef ( Element : integer ) ;                          {!!}
  22. var
  23.    i                         : integer ;
  24. begin
  25.     for i := MaxHelp downto 2 do
  26.         StackHelp [ i ]      := StackHelp [ i - 1 ] ;
  27.     StackHelp [ 1 ]          := Element ;
  28. end ;
  29.  
  30. function PopRef : integer ;                                        {!!}
  31. var
  32.    i                         : integer ;
  33. begin
  34.    for i := 1 to ( MaxHelp - 1 ) do
  35.        StackHelp [ i ]       := StackHelp [ i + 1 ] ;
  36.    StackHelp [ MaxHelp ]     := 0 ;
  37.    PopRef                    := StackHelp [ 1 ] ;
  38. end ;
  39.    {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  40.    Add to "THelpViewer.HandleEvent ( ) ;"
  41.    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
  42. begin
  43.    ...
  44.    evKeyDown :
  45.    ...
  46.       kbEnter :
  47.       ...
  48.          Topic^.GetCrossRef ( Selected , KeyPoint , KeyLength , KeyRef ) ;
  49.          SwitchToTopic ( KeyRef ) ;
  50.          PushRef ( KeyRef ) ;                    {!!} {push new screen}
  51.       ...
  52.       kbAltF1 : SwitchToTopic ( PopRef ) ;        {!!} {pop old screen}
  53.    ...
  54.    evMouseDown :
  55.       begin
  56.          ...
  57.          if Event.Double then
  58.          begin                                                     {!!}
  59.             SwitchToTopic ( KeyRef ) ;
  60.             PushRef ( KeyRef ) ;                                   {!!}
  61.          end ;                                                     {!!}
  62.       end ;
  63. end ;
  64.    {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  65.    Add at end of "THelpWindow.Init ( ) ;"
  66.    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
  67. begin
  68.    ...
  69.    PushRef ( Context ) ;                                           {!!}
  70. end ;
  71.    {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  72.    Add to UNIT initialization
  73.    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
  74. BEGIN
  75.    FillChar ( StackHelp , SizeOf ( StackHelp ) , #0 ) ;            {!!}
  76. END .
  77. -----------------------------------------------------------------------
  78.